package work.day09work;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

/**
 * @author Administrator
 * @Description
 * @date 2022/5/11 20:17
 **/
public class Test04 {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < 100; i++) {
            list.add(i + 1);
        }
        System.out.println(list);
        Iterator<Integer> it = list.iterator();
        while (it.hasNext()){
            System.out.println(it.next());
        }

        List<Integer> sub = list.subList(39, 60);
        Collections.reverse(sub);
        System.out.println(list);
    }
}
